<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>The Creator</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'The Creator' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">assertions</a></li><li><a href="index.html#4">Chapter 4: Assertions</a></li><li><b>The Creator</b></li></ul></div>
<p class="purpose">This is where all objects, kinds of object, named values, kinds of value and global variables are made.</p>

<ul class="toc"><li><a href="4-tc.html#SP1">&#167;1. Creations to match unrecognised names</a></li><li><a href="4-tc.html#SP4">&#167;4. Acting on creations</a></li><li><a href="4-tc.html#SP8">&#167;8. Creations to instantiate</a></li><li><a href="4-tc.html#SP12">&#167;12. The natural language kind</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Creations to match unrecognised names.</b>The model contains objects, their properties and their relationships, and
this section is where all of the objects are created &mdash; not only world
objects (like rooms and people) but also named values.
</p>

<p class="commentary">The model world is initially empty. It grows gradually as sentences are
read in, or to be more accurate as they are traversed in the first major
pass through assertions. For example, we reach:
</p>

<blockquote>
    <p>Fifi is in the wicker basket.</p>
</blockquote>

<p class="commentary">The two sides of the assertion are, respectively, <span class="extract"><span class="extract-syntax">px</span></span>:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">node:PROPER_NOUN_NT</span><span class="plain-syntax">  </span><span class="function-syntax">&lt;fifi&gt;</span><span class="plain-syntax"> (</span><span class="identifier-syntax">no</span><span class="plain-syntax"> </span><span class="identifier-syntax">article</span><span class="plain-syntax">)</span>
</pre>
<p class="commentary">And <span class="extract"><span class="extract-syntax">py</span></span>:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">node:RELATIONSHIP_NT</span><span class="plain-syntax">  </span><span class="function-syntax">&lt;in&gt;</span><span class="plain-syntax"> (</span><span class="identifier-syntax">type:standard</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">node:PROPER_NOUN_NT</span><span class="plain-syntax">  &lt;</span><span class="identifier-syntax">wicker</span><span class="plain-syntax"> </span><span class="identifier-syntax">basket</span><span class="plain-syntax">&gt; (</span><span class="identifier-syntax">definite</span><span class="plain-syntax">)</span>
</pre>
<p class="commentary">The Creator is not alas a cultured gentleman with a white-pointed beard, a
roll of architect's plans and a set square, perhaps played by an American
character actor in a movie like "The Matrix". It's just a routine which
returns either <span class="extract"><span class="extract-syntax">TRUE</span></span> or <span class="extract"><span class="extract-syntax">FALSE</span></span>, giving permission for reading of the
sentence to continue; and it always grants this permission unless a problem
message had to be issued during its work.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">problem_count_when_creator_started</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::consult_the_creator</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::consult_the_creator</span></span>:<br/>Refine Parse Tree - <a href="4-rpt.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">px</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">py</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">problem_count_when_creator_started</span><span class="plain-syntax"> = </span><span class="identifier-syntax">problem_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;np-existential&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">px</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP1_1" class="named-paragraph-link"><span class="named-paragraph">Perform creation duties on a "There is..." sentence</span><span class="named-paragraph-number">1.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP1_2" class="named-paragraph-link"><span class="named-paragraph">Perform creation duties on a copular sentence</span><span class="named-paragraph-number">1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">problem_count</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">problem_count_when_creator_started</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP1_1" class="paragraph-anchor"></a><b>&#167;1.1. </b>This is the simpler case. Usually what goes on in the <span class="extract"><span class="extract-syntax">px</span></span> side affects what
creations we make in the <span class="extract"><span class="extract-syntax">py</span></span> side and vice versa, but here there's no
information on the <span class="extract"><span class="extract-syntax">px</span></span> side, "there" being essentially a meaningless
placeholder in English, like the "it" in "it is raining".
</p>

<p class="commentary">Note that only the most primitive "there is" sentences turn up here.
Something like "There is a man in the Dining Room" is given a tree form
equivalent to "A man is in the Dining Room", and falls into the copular
case below. The only sentences coming here are things like "There is a
room."
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Perform creation duties on a "There is..." sentence</span><span class="named-paragraph-number">1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-tc.html#SP4" class="function-link"><span class="function-syntax">Assertions::Creator::noun_creator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">py</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2" class="paragraph-anchor"></a><b>&#167;1.2. </b>More generally we need to work out what <span class="extract"><span class="extract-syntax">px</span></span> tells us about creations in <span class="extract"><span class="extract-syntax">py</span></span>,
and vice versa. In particular, in terms of the kind of value involved. For
example:
</p>

<blockquote>
    <p>A man is in the Dining Room. Red is a colour.</p>
</blockquote>

<p class="commentary">In each case <span class="extract"><span class="extract-syntax">px</span></span> describes something which will need to be created, but <span class="extract"><span class="extract-syntax">py</span></span>
tells us what kind it has: a colour in the second sentence here, but an object
in the first. (We do not need to decide the kind of object here, and
don't: it's sufficient to pin it down as far as "object".) The information
about this kind of value sometimes comes from a particular node somewhere
in <span class="extract"><span class="extract-syntax">py</span></span>, which (if it exists) we'll call its "governing node".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Perform creation duties on a copular sentence</span><span class="named-paragraph-number">1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::creation</span><span class="plain-syntax">(</span><span class="identifier-syntax">px</span><span class="plain-syntax">, </span><span class="identifier-syntax">py</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">govx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">govy</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kindx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">kindy</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP1_2_1" class="named-paragraph-link"><span class="named-paragraph">Work out the kinds of value expressed by each side, and find their governing nodes</span><span class="named-paragraph-number">1.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="4-tc.html#SP4" class="function-link"><span class="function-syntax">Assertions::Creator::noun_creator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">px</span><span class="plain-syntax">, </span><span class="identifier-syntax">kindy</span><span class="plain-syntax">, </span><span class="identifier-syntax">govy</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-tc.html#SP4" class="function-link"><span class="function-syntax">Assertions::Creator::noun_creator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">py</span><span class="plain-syntax">, </span><span class="identifier-syntax">kindx</span><span class="plain-syntax">, </span><span class="identifier-syntax">govx</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2_1" class="paragraph-anchor"></a><b>&#167;1.2.1. </b>There are two ways to know the kind being expressed. One is that the sentence
makes unambiguous use of a relation which forces the kinds on each side. For
example,
</p>

<blockquote>
    <p>The ball is on the box.</p>
</blockquote>

<p class="commentary">uses the binary predicate supports, which requires its terms to be
objects. (In fact it requires them to be a thing and a supporter, but we
weaken those into just "object", since that's all we need to know for
creation purposes.) The code we use here looks asymmetric since it searches
<span class="extract"><span class="extract-syntax">py</span></span> ahead of <span class="extract"><span class="extract-syntax">px</span></span>, but in fact the two sides can't both contain a relation
without throwing a problem message (e.g., "In the trunk is on the table."),
so the code here is completely symmetrical in <span class="extract"><span class="extract-syntax">px</span></span> and <span class="extract"><span class="extract-syntax">py</span></span>.
</p>

<p class="commentary">Containment is a slight exception because, for reasons to do with the
ambiguity between direct and indirect containment, it does not force the
kind of its second term. So we do so on its behalf.
</p>

<p class="commentary">The other way to find the kinds is to look at what the two sides explicitly say:
</p>

<blockquote>
    <p>Green is a colour.</p>
</blockquote>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work out the kinds of value expressed by each side, and find their governing nodes</span><span class="named-paragraph-number">1.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP2" class="function-link"><span class="function-syntax">Assertions::Creator::bp_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">py</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">bp</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP2" class="function-link"><span class="function-syntax">Assertions::Creator::bp_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">px</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kindx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Kinds::weaken</span><span class="plain-syntax">(</span><span class="identifier-syntax">BinaryPredicates::term_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kindy</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Kinds::weaken</span><span class="plain-syntax">(</span><span class="identifier-syntax">BinaryPredicates::term_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> == </span><span class="identifier-syntax">R_containment</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">BinaryPredicates::get_reversal</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) == </span><span class="identifier-syntax">R_containment</span><span class="plain-syntax">)) { </span><span class="identifier-syntax">kindx</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">; </span><span class="identifier-syntax">kindy</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">kindx</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">kindy</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kindx</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">px</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">govx</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kindy</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">py</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">govy</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP1_2">&#167;1.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>So that just leaves the algorithms for finding the relation of a subtree:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="function-syntax">Assertions::Creator::bp_of_subtree</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::bp_of_subtree</span></span>:<br/><a href="4-tc.html#SP1_2_1">&#167;1.2.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">) == </span><span class="identifier-syntax">RELATIONSHIP_NT</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Node::get_relationship</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>And the kind of a subtree.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="function-syntax">Assertions::Creator::kind_of_subtree</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></span>:<br/><a href="4-tc.html#SP1_2_1">&#167;1.2.1</a>, <a href="4-tc.html#SP3_1">&#167;3.1</a>, <a href="4-tc.html#SP4_2">&#167;4.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> **</span><span class="identifier-syntax">governing</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">AND_NT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_1" class="named-paragraph-link"><span class="named-paragraph">Recurse downwards, preferring the leftmost item in a list</span><span class="named-paragraph-number">3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">WITH_NT:</span><span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">, </span><span class="identifier-syntax">governing</span><span class="plain-syntax">); </span><span class="comment-syntax"> the owner, not the property</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">KIND_NT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_2" class="named-paragraph-link"><span class="named-paragraph">Handle the kind of a "kind of..." clause</span><span class="named-paragraph-number">3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">default:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_3" class="named-paragraph-link"><span class="named-paragraph">Kinds of variable and of value produce the obvious kind as result</span><span class="named-paragraph-number">3.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_4" class="named-paragraph-link"><span class="named-paragraph">Initially values produce their own weakened kind</span><span class="named-paragraph-number">3.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_6" class="named-paragraph-link"><span class="named-paragraph">Descriptions produce the kind of whatever's described</span><span class="named-paragraph-number">3.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP3_5" class="named-paragraph-link"><span class="named-paragraph">Property names coinciding with kinds are considered with their kind meanings</span><span class="named-paragraph-number">3.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3_1" class="paragraph-anchor"></a><b>&#167;3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Recurse downwards, preferring the leftmost item in a list</span><span class="named-paragraph-number">3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">left</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">, </span><span class="identifier-syntax">governing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">right</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">, </span><span class="identifier-syntax">governing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">left</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">left</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">right</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_2" class="paragraph-anchor"></a><b>&#167;3.2. </b>Refinement has already parsed a KIND subtree and left the resulting domain
in the node's subject, so this case is easy.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Handle the kind of a "kind of..." clause</span><span class="named-paragraph-number">3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    *</span><span class="identifier-syntax">governing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">KindSubjects::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_3" class="paragraph-anchor"></a><b>&#167;3.3. </b>Less surprisingly, "number that varies" and "number" return <span class="extract"><span class="extract-syntax">K_number</span></span>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Kinds of variable and of value produce the obvious kind as result</span><span class="named-paragraph-number">3.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Specifications::is_new_variable_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Specifications::is_kind_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">found</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_new_variable_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">found</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">; </span><span class="comment-syntax"> Specifications::kind_of_new_variable_like(spec);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_kind_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) </span><span class="identifier-syntax">found</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">found</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            *</span><span class="identifier-syntax">governing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">found</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">found</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_4" class="paragraph-anchor"></a><b>&#167;3.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Initially values produce their own weakened kind</span><span class="named-paragraph-number">3.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">INITIALLY_CE</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Node::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">CONSTANT_NT</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">Lvalues::is_constant_NONLOCAL_VARIABLE</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">            *</span><span class="identifier-syntax">governing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Kinds::weaken</span><span class="plain-syntax">(</span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_5" class="paragraph-anchor"></a><b>&#167;3.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Property names coinciding with kinds are considered with their kind meanings</span><span class="named-paragraph-number">3.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_construction</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">CON_property</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">property</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::to_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Properties::is_either_or</span><span class="plain-syntax">(</span><span class="identifier-syntax">prn</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">ValueProperties::coincides_with_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">prn</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">ValueProperties::kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">prn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_6" class="paragraph-anchor"></a><b>&#167;3.6. </b>And similarly "even number" returns <span class="extract"><span class="extract-syntax">K_number</span></span>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Descriptions produce the kind of whatever's described</span><span class="named-paragraph-number">3.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_description</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        *</span><span class="identifier-syntax">governing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Acting on creations.</b>Building and refining the parse tree was a compositional process, in a linguistic
sense: what you do at any given position depends only on the current phrase and
its contents, or equivalently, on the current node and its children.
</p>

<p class="commentary">The creator is not compositional. What it does to the phrase "Miss Bianca",
words with no meaning as yet, depends on the rest of the sentence, as these
two alternatives show:
</p>

<blockquote>
    <p>[1] Miss Bianca is an animal. [2] Miss Bianca is a number that varies.</p>
</blockquote>

<p class="commentary">Nevertheless, the code has been structured to minimise the extent to which
information moves across the tree rather than upwards. When <span class="extract"><span class="extract-syntax">Assertions::Creator::noun_creator</span></span>
is applied to a given node, it is allowed access to that node and all its
children, and can otherwise see only two pieces of information: the kind
for any creation ("animal" or "number", above) and, in some cases, also
a reference to which node in the tree determined this &mdash; the "governor".
</p>

<p class="commentary">We recurse downwards, looking only for <span class="extract"><span class="extract-syntax">CALLED_NT</span></span> and <span class="extract"><span class="extract-syntax">CREATED_NT</span></span> nodes,
both of which are excised and replaced with <span class="extract"><span class="extract-syntax">COMMON_NOUN_NT</span></span> or
<span class="extract"><span class="extract-syntax">PROPER_NOUN_NT</span></span> nodes as appropriate.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">allow_tabular_definitions_from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::tabular_definitions</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::tabular_definitions</span></span>:<br/>Define by Table Requests - <a href="3-dbtr.html#SP4_1_3">&#167;4.1.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">allow_tabular_definitions_from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::noun_creator</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::noun_creator</span></span>:<br/><a href="4-tc.html#SP1_1">&#167;1.1</a>, <a href="4-tc.html#SP1_2">&#167;1.2</a>, <a href="4-tc.html#SP4_2">&#167;4.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">governor</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CALLED_NT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_1" class="named-paragraph-link"><span class="named-paragraph">Check we are sure about this</span><span class="named-paragraph-number">4.1</span></a></span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_2" class="named-paragraph-link"><span class="named-paragraph">Perform creation on a CALLED node</span><span class="named-paragraph-number">4.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CREATED_NT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_1" class="named-paragraph-link"><span class="named-paragraph">Check we are sure about this</span><span class="named-paragraph-number">4.1</span></a></span><span class="plain-syntax">; </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3" class="named-paragraph-link"><span class="named-paragraph">Perform creation on a CREATED node</span><span class="named-paragraph-number">4.3</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ch</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ch</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) </span><a href="4-tc.html#SP4" class="function-link"><span class="function-syntax">Assertions::Creator::noun_creator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ch</span><span class="plain-syntax">, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">governor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4_1" class="paragraph-anchor"></a><b>&#167;4.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check we are sure about this</span><span class="named-paragraph-number">4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">IMPOSSIBLE_CE</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">UNLIKELY_CE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NegativeCreation</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"sentences are only allowed to say that things do exist"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"not that they don't."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4">&#167;4</a> (twice) and <a href="4-tc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2" class="paragraph-anchor"></a><b>&#167;4.2. </b>CALLED nodes allow a much more generous range of names to be used &mdash; that's
the whole point of them. Really they contain the whole language in miniature,
because a "called" clause can specify not only the name but also its kind,
some properties which it has, and so forth. For example:
</p>

<blockquote>
    <p>There is a recurring scene called Expedited Banana Shipment.</p>
</blockquote>

<p class="commentary">Thus the CALLED subtree sometimes has "local" information about what to
make which overrides any information coming down from the tree above. This
is important for sentences like:
</p>

<blockquote>
    <p>A man called Peter is in the Dining Room.</p>
</blockquote>

<p class="commentary">The tree above mandates that a creation in "A man called Peter" has to be
an object, but we know locally that Peter must further have the kind "man".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Perform creation on a CALLED node</span><span class="named-paragraph-number">4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="comment-syntax"> e.g., "a man"</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">; </span><span class="comment-syntax"> a </span><span class="extract"><span class="extract-syntax">CREATED_NT</span></span><span class="comment-syntax"> node, e.g., "Peter"</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">) != </span><span class="identifier-syntax">COMMON_NOUN_NT</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">) != </span><span class="identifier-syntax">WITH_NT</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_2_3" class="named-paragraph-link"><span class="named-paragraph">Complain that nothing else can be called</span><span class="named-paragraph-number">4.2.3</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">local_governor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">local_create_as</span><span class="plain-syntax"> = </span><a href="4-tc.html#SP3" class="function-link"><span class="function-syntax">Assertions::Creator::kind_of_subtree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">local_governor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">local_create_as</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">local_create_as</span><span class="plain-syntax"> = </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">; </span><span class="identifier-syntax">local_governor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">governor</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><a href="4-tc.html#SP4" class="function-link"><span class="function-syntax">Assertions::Creator::noun_creator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax">, </span><span class="identifier-syntax">local_create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">local_governor</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_2_1" class="named-paragraph-link"><span class="named-paragraph">Replace the CALLED subtree with the new creation, mutatis mutandis</span><span class="named-paragraph-number">4.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_2_2" class="named-paragraph-link"><span class="named-paragraph">If the CALLED name used the definite article, make a note of that</span><span class="named-paragraph-number">4.2.2</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4">&#167;4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_1" class="paragraph-anchor"></a><b>&#167;4.2.1. </b>This is where we act on the miniature sentence implied by the CALLED
subtree. We replace the subtree with a single node &mdash; the result of creation
on the <span class="extract"><span class="extract-syntax">called_name_node</span></span> side &mdash; but then apply to it any kind, proposition
or adjectives specified in the <span class="extract"><span class="extract-syntax">what_to_make_node</span></span> side.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Replace the CALLED subtree with the new creation, mutatis mutandis</span><span class="named-paragraph-number">4.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p_sibling</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax">); </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p_sibling</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new_creation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">its_domain</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">new_creation</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">its_domain</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="8-cu.html#SP3" class="function-link"><span class="function-syntax">Propositions::Abstract::assert_kind_of_subject</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">new_creation</span><span class="plain-syntax">, </span><span class="identifier-syntax">its_domain</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Specifications::to_proposition</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">)));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">) == </span><span class="identifier-syntax">WITH_NT</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="4-pk.html#SP2" class="function-link"><span class="function-syntax">Assertions::PropertyKnowledge::assert_property_list</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_2" class="paragraph-anchor"></a><b>&#167;4.2.2. </b>Ordinarily the use of the definite article doesn't tell us much, but
consider the following two sentences:
</p>

<blockquote>
    <p>There is a man called the Assessor. There is a man called Eric Eve.</p>
</blockquote>

<p class="commentary">Clearly "Eric Eve" is a proper name, but "Assessor" is not; the use of
"the" here was significant. (We only allow proper names for objects, which
is why the following only applies to those.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">If the CALLED name used the definite article, make a note of that</span><span class="named-paragraph-number">4.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax">) == </span><span class="identifier-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Articles::may_be_definite</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_article</span><span class="plain-syntax">(</span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax">)))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">InferenceSubjects::is_an_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">subj</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">InferenceSubjects::is_a_kind_of_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">subj</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Naming::object_takes_definite_article</span><span class="plain-syntax">(</span><span class="identifier-syntax">subj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3" class="paragraph-anchor"></a><b>&#167;4.2.3. </b>Note that even in this problem case, the <span class="extract"><span class="extract-syntax">CALLED_NT</span></span> node is removed. It
disappears from the tree entirely when the creator has finished work.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Complain that nothing else can be called</span><span class="named-paragraph-number">4.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"$T\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">what_to_make_node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_CalledWithoutKind</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I can only make 'a something called whatever' when the something is a kind I know"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"possibly qualified with adjectives. For instance, 'an open door called the Marble "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"Door' is fine because 'door' is the name of a kind and 'open' is an adjective "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which means something for doors. But 'a grand archway called the Great Gates' "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"would not normally mean anything to me, because 'archway' is not one of the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"standard kinds in Inform. (Try consulting the Kinds index.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="comment-syntax"> now recover from the error as best we can:</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::set_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">CREATED_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::set_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">called_name_node</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>Names are not permitted to contain brackets, but we do allow them as an indicator
of grammatical gender for languages other than English.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;grammatical-gender-marker&gt;</span>
<span class="plain-syntax">    ... ( </span><span class="function-syntax">&lt;grammatical-gender-abbreviation&gt;</span><span class="plain-syntax"> )</span>

<span class="function-syntax">&lt;grammatical-gender-abbreviation&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">n</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">m</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">f</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4_3" class="paragraph-anchor"></a><b>&#167;4.3. </b>That's it for callings; on to the main case, where we have a <span class="extract"><span class="extract-syntax">CREATED_NT</span></span>
node which invites us to make something of it. In every case it becomes one
of <span class="extract"><span class="extract-syntax">COMMON_NOUN_NT</span></span> (e.g., "Colour is a kind of value"); or <span class="extract"><span class="extract-syntax">PROPER_NOUN_NT</span></span>
(e.g., "Miss Bianca is an animal"). Thus every <span class="extract"><span class="extract-syntax">CREATED_NT</span></span> node disappears
from the tree.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Perform creation on a CREATED node</span><span class="named-paragraph-number">4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::empty</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">problem_count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> to recover from PM_TableDefiningNothing</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"CREATED node without name"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;grammatical-gender-marker&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">GET_RW</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;grammatical-gender-marker&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">explicit_gender_marker_ANNOT</span><span class="plain-syntax">, </span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">XW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">W</span><span class="plain-syntax">; </span><span class="identifier-syntax">DocReferences::position_of_symbol</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">XW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;creation-problem-diagnosis&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">XW</span><span class="plain-syntax">)) </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::set_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">create_as</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">))) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> != </span><span class="identifier-syntax">INITIALLY_CE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> != </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_1" class="named-paragraph-link"><span class="named-paragraph">Create an object or kind of object rather than a value</span><span class="named-paragraph-number">4.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_subject_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">Instances::as_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2" class="named-paragraph-link"><span class="named-paragraph">Create a value rather than an object</span><span class="named-paragraph-number">4.3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_spec_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">val</span><span class="plain-syntax">) </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4">&#167;4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>There now follows a pretty tedious trawl through reasons to object to names.
The crash hieroglyphs exist only so that the Inform test suite can verify that
it handles crashes correctly.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;creation-problem-diagnosis&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;article&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    (/)/(- *** |</span>
<span class="plain-syntax">    *** (/)/(- |</span>
<span class="plain-syntax">    ... (/)/(- ... |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ni</span><span class="plain-syntax">--</span><span class="identifier-syntax">crash</span><span class="plain-syntax">--1 |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ni</span><span class="plain-syntax">--</span><span class="identifier-syntax">crash</span><span class="plain-syntax">--10 |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ni</span><span class="plain-syntax">--</span><span class="identifier-syntax">crash</span><span class="plain-syntax">--11 |</span>
<span class="plain-syntax">    , ... |</span>
<span class="plain-syntax">    ... , |</span>
<span class="plain-syntax">    ... </span><span class="identifier-syntax">when</span><span class="plain-syntax">/</span><span class="reserved-syntax">while</span><span class="plain-syntax"> ... |</span>
<span class="plain-syntax">    *** </span><span class="function-syntax">&lt;quoted-text&gt;</span><span class="plain-syntax"> *** |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">condition</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">conditions</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">storage</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">storages</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">variable</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">variables</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">property</span><span class="plain-syntax">-</span><span class="identifier-syntax">value</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">property</span><span class="plain-syntax">-</span><span class="identifier-syntax">values</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">table</span><span class="plain-syntax">-</span><span class="identifier-syntax">reference</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">table</span><span class="plain-syntax">-</span><span class="identifier-syntax">references</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">list</span><span class="plain-syntax">-</span><span class="identifier-syntax">entry</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">list</span><span class="plain-syntax">-</span><span class="identifier-syntax">entries</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6_1" class="paragraph-anchor"></a><b>&#167;6.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_NameIsArticle problem</span><span class="named-paragraph-number">6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NameIsArticle</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this seems to give something a name which consists only of an article"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"that is, 'a', 'an', 'the' or 'some'. This is not allowed since the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"potential for confusion is too high. (If you need, say, a room which "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"the player sees as just 'A', you can get this effect with: 'A-Room is "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"a room with printed name \"A\".')"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2" class="paragraph-anchor"></a><b>&#167;6.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_NameWithBrackets problem</span><span class="named-paragraph-number">6.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NameWithBrackets</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"The sentence %1 seems to give something the name '%2', but that name "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"contains brackets '(' or ')', which is not allowed since the potential "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"for confusion with other uses for brackets in Inform source text is too "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"high. (If you need, say, a room which the player sees as 'Fillmore (West)', "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"you can get this effect with: 'Fillmore West is a room with printed name "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"\"Fillmore (West)\".')"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a> (three times).</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3" class="paragraph-anchor"></a><b>&#167;6.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_Crash1 problem</span><span class="named-paragraph-number">6.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"*** Exit(1) requested for testing purposes ***\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">STREAM_FLUSH</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_Crash1</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this uses the first secret hieroglyph of dreadful power"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which forces me to crash. (It's for testing the way I crash, in fact. "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"If this is a genuine inconvenience to you, get in touch with my authors.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ProblemSigils::exit</span><span class="plain-syntax">(1);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4" class="paragraph-anchor"></a><b>&#167;6.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_Crash10 problem</span><span class="named-paragraph-number">6.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"*** Exit(10) requested for testing purposes ***\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">STREAM_FLUSH</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_Crash10</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this uses the second secret hieroglyph of dreadful power"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which forces me to crash. (It's for testing the way I crash, in fact. "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"If this is a genuine inconvenience to you, get in touch with my authors.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ProblemSigils::exit</span><span class="plain-syntax">(10);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5" class="paragraph-anchor"></a><b>&#167;6.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_Crash11 problem</span><span class="named-paragraph-number">6.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"*** Exit(11) requested for testing purposes ***\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">STREAM_FLUSH</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_Crash11</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this uses the third secret hieroglyph of dreadful power"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which forces me to crash. (It's for testing the way I crash, in fact. "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"If this is a genuine inconvenience to you, get in touch with my authors.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ProblemSigils::exit</span><span class="plain-syntax">(11);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6" class="paragraph-anchor"></a><b>&#167;6.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_StartsWithComma problem</span><span class="named-paragraph-number">6.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"$T\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_StartsWithComma</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this seems to refer to something whose name begins with a comma"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which is forbidden. Perhaps you used a comma in punctuating a sentence? "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"Inform generally doesn't like this because it reserves commas for "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"specific purposes such as dividing rules or 'if' phrases."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7" class="paragraph-anchor"></a><b>&#167;6.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_EndsWithComma problem</span><span class="named-paragraph-number">6.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_EndsWithComma</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this seems to refer to something whose name ends with a comma"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which is forbidden. Perhaps you used a comma in punctuating a sentence? "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"Inform generally doesn't like this because it reserves commas for "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"specific purposes such as dividing rules or 'if' phrases."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_8" class="paragraph-anchor"></a><b>&#167;6.8. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_ObjectIncWhen problem</span><span class="named-paragraph-number">6.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ObjectIncWhen</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"The sentence %1 seems to be talking about a previously unknown room or "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"thing called %2. Ordinarily, I would create this, but because the name "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"contains the word 'when' or 'while' I'm going to say no. %P"</span>
<span class="plain-syntax">        </span><span class="string-syntax">"That's because this far more often happens by mistake than deliberately. "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"For instance, people sometimes type lines like 'Jumping when the actor "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"is on the trampoline is high-jumping.' But in fact although 'jumping' "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"is an action, 'Jumping when...' is not - 'when' can't be used here "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"(though it can be used in rule preambles). So the sentence is instead "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"read as making an object 'jumping when the actor' and putting it on top "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"of another one, 'trampoline is high-jumping'. This can lead to a lot of "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"confusion. %P"</span>
<span class="plain-syntax">        </span><span class="string-syntax">"If you genuinely do want an object whose name contains the word 'when', "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"try something like: 'In the box is a thing called When worlds collide.'"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_9" class="paragraph-anchor"></a><b>&#167;6.9. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_NameWithText problem</span><span class="named-paragraph-number">6.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NameWithText</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this seems to give something a name which contains "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"double-quoted text"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which is not allowed. If you do need quotes in a name, one option "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"would be to write something like 'In the Saloon is 'Black' Jacques "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"Bernoulli.'; but this problem message is often caused by an "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"accident in punctuation, in which case you never intended to "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"create an object - you thought that the text ended a sentence "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"because it finished with sentence-ending punctuation, when in "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"fact it didn't, so that I read the next words as following on."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_10" class="paragraph-anchor"></a><b>&#167;6.10. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_NameReserved problem</span><span class="named-paragraph-number">6.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NameReserved</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this seems to give something a name which is reserved for Inform's "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"own internal use"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"so is not allowed. There are only a few of these - 'storage', "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"'variable', 'condition', 'phrase' and 'action', for example. But "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"whatever you were making here, you'll need to call it something "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"else."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP6">&#167;6</a> (12 times).</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_1" class="paragraph-anchor"></a><b>&#167;4.3.1. </b>At this point we do something that might look odd: we check to see if the
text of the <span class="extract"><span class="extract-syntax">CREATED_NT</span></span> node is the name of an object already. That seems
pointless, since <span class="extract"><span class="extract-syntax">CREATED_NT</span></span> nodes are only made when a name is meaningless.
But that was a little while ago, before we started to make creations within
the current sentence.
</p>

<p class="commentary">This all hangs on the interpretation of sentences like so:
</p>

<blockquote>
    <p>Malcolm believes Malcolm.</p>
</blockquote>

<p class="commentary">which make the first mentions of "Malcolm". These are both <span class="extract"><span class="extract-syntax">CREATED_NT</span></span>
nodes; the first causes "Malcolm" to be created; and then, when we reach
the second one, we find that <span class="extract"><span class="extract-syntax">recent_creation</span></span> points to it, so we do not
need to make a second creation. The two Malcolms are, in fact, references
to the same object.
</p>

<p class="commentary">We do insist, however, on the names being given in exactly the same form.
</p>

<blockquote>
    <p>Malcolm X believes Malcolm.</p>
</blockquote>

<p class="commentary">creates two different objects with different names, even though references
to abbreviated forms of object names are normally allowed.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an object or kind of object rather than a value</span><span class="named-paragraph-number">4.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;instance-of-object&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">RW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::get_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">RW</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Wordings::match</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">, </span><span class="identifier-syntax">RW</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_1_1" class="named-paragraph-link"><span class="named-paragraph">Actually create a fresh object</span><span class="named-paragraph-number">4.3.1.1</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3">&#167;4.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_1_1" class="paragraph-anchor"></a><b>&#167;4.3.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Actually create a fresh object</span><span class="named-paragraph-number">4.3.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">is_a_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">governor</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">governor</span><span class="plain-syntax">) == </span><span class="identifier-syntax">KIND_NT</span><span class="plain-syntax">)) </span><span class="identifier-syntax">is_a_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K_object</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">is_a_kind</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Propositions::concatenate</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_make_a_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K_object</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">is_a_kind</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::latest</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">article_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">au</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_article</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">au</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Naming::object_now_has_proper_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Stock::usage_might_be_singular</span><span class="plain-syntax">(</span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">usage</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Naming::object_now_has_plural_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">g</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">gender_certainty</span><span class="plain-syntax"> = </span><span class="identifier-syntax">UNKNOWN_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">au</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">g</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lcon::get_gender</span><span class="plain-syntax">(</span><span class="identifier-syntax">Stock::first_form_in_usage</span><span class="plain-syntax">(</span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">usage</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">gender_certainty</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LIKELY_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">explicit_gender_marker_ANNOT</span><span class="plain-syntax">) != </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">g</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">explicit_gender_marker_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">gender_certainty</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">g</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">P_grammatical_gender</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">GI</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::grammatical</span><span class="plain-syntax">(</span><span class="identifier-syntax">g</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">GI</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">ValueProperties::assert</span><span class="plain-syntax">(</span><span class="identifier-syntax">P_grammatical_gender</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Instances::as_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">recent_creation</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Rvalues::from_instance</span><span class="plain-syntax">(</span><span class="identifier-syntax">GI</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">gender_certainty</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">latest_base_kind_of_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_spec_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_1">&#167;4.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2" class="paragraph-anchor"></a><b>&#167;4.3.2. </b>Something of a rag-bag, this: it's everything else that can be created.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a value rather than an object</span><span class="named-paragraph-number">4.3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">governor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">governor</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Node::get_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">governor</span><span class="plain-syntax">) == </span><span class="identifier-syntax">KIND_NT</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_1" class="named-paragraph-link"><span class="named-paragraph">Create a new kind of value</span><span class="named-paragraph-number">4.3.2.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Specifications::is_new_variable_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">INITIALLY_CE</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_2" class="named-paragraph-link"><span class="named-paragraph">Create a new variable</span><span class="named-paragraph-number">4.3.2.2</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CON_rulebook</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_4" class="named-paragraph-link"><span class="named-paragraph">Create a new rulebook</span><span class="named-paragraph-number">4.3.2.4</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CON_activity</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_5" class="named-paragraph-link"><span class="named-paragraph">Create a new activity</span><span class="named-paragraph-number">4.3.2.5</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::definite</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Kinds::Behaviour::is_quasinumerical</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_6" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for trying to create an instance of a unit</span><span class="named-paragraph-number">4.3.2.6</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::definite</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">RTTables::table_defining_this</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">RTTables::table_defining_this</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">) != </span><span class="identifier-syntax">allow_tabular_definitions_from</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_7" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for trying to create an instance of a table-defined kind</span><span class="named-paragraph-number">4.3.2.7</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::definite</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Kinds::Behaviour::has_named_constant_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_3" class="named-paragraph-link"><span class="named-paragraph">Create an instance of an enumerated kind</span><span class="named-paragraph-number">4.3.2.3</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_8" class="named-paragraph-link"><span class="named-paragraph">Issue an unable-to-create problem message</span><span class="named-paragraph-number">4.3.2.8</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DocReferences::position_of_symbol</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::set_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3">&#167;4.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_1" class="paragraph-anchor"></a><b>&#167;4.3.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a new kind of value</span><span class="named-paragraph-number">4.3.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Propositions::concatenate</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_make_a_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">latest_base_kind_of_value</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_2" class="paragraph-anchor"></a><b>&#167;4.3.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a new variable</span><span class="named-paragraph-number">4.3.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">domain</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_kind_of_value</span><span class="plain-syntax">(</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">domain</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">domain</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Kinds::weaken</span><span class="plain-syntax">(</span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_new_variable_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">domain</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::kind_of_new_variable_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">governing_spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Kinds::contains</span><span class="plain-syntax">(</span><span class="identifier-syntax">domain</span><span class="plain-syntax">, </span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax">))))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_2_1" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for topics that vary</span><span class="named-paragraph-number">4.3.2.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">domain</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> == </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Propositions::concatenate</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_make_a_const</span></a><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Propositions::concatenate</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_make_a_var</span></a><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">NonlocalVariables::get_latest</span><span class="plain-syntax">() == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"failed to create"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::new_actual_NONLOCAL_VARIABLE</span><span class="plain-syntax">(</span><span class="identifier-syntax">NonlocalVariables::get_latest</span><span class="plain-syntax">());</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_3" class="paragraph-anchor"></a><b>&#167;4.3.2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an instance of an enumerated kind</span><span class="named-paragraph-number">4.3.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::forbid_assertion_creation</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_3_2_3_1" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for certain forbidden kinds</span><span class="named-paragraph-number">4.3.2.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">such_that</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_creation_proposition</span><span class="plain-syntax">(</span><span class="identifier-syntax">governor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">such_that</span><span class="plain-syntax">) </span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Propositions::concatenate</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">such_that</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::from_instance</span><span class="plain-syntax">(</span><span class="identifier-syntax">Instances::latest</span><span class="plain-syntax">());</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_4" class="paragraph-anchor"></a><b>&#167;4.3.2.4. </b>Lastly: rulebooks and activities are not part of the model, because they would
make it enormously larger, and because they describe only the run-time evolution
of the state of play and have no effect on the initial state. So we don't create
them by asserting propositions to be true; we act directly.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a new rulebook</span><span class="named-paragraph-number">4.3.2.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">basis</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">producing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">basis</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">producing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">basis</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">)) </span><span class="identifier-syntax">basis</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_action_name</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">producing</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">)) </span><span class="identifier-syntax">producing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_void</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">create_as</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Kinds::binary_con</span><span class="plain-syntax">(</span><span class="identifier-syntax">CON_rulebook</span><span class="plain-syntax">, </span><span class="identifier-syntax">basis</span><span class="plain-syntax">, </span><span class="identifier-syntax">producing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">governor</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::set_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">governor</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Specifications::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rulebook</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rb</span><span class="plain-syntax"> = </span><a href="6-rlb.html#SP2" class="function-link"><span class="function-syntax">Rulebooks::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::from_rulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">rb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">, </span><span class="identifier-syntax">clears_pronouns_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_5" class="paragraph-anchor"></a><b>&#167;4.3.2.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a new activity</span><span class="named-paragraph-number">4.3.2.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">activity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">av</span><span class="plain-syntax"> = </span><a href="6-act.html#SP4" class="function-link"><span class="function-syntax">Activities::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">av</span><span class="plain-syntax">) </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::from_activity</span><span class="plain-syntax">(</span><span class="identifier-syntax">av</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">, </span><span class="identifier-syntax">clears_pronouns_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_2_1" class="paragraph-anchor"></a><b>&#167;4.3.2.2.1. </b>And to wind up, sundry problem messages.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for topics that vary</span><span class="named-paragraph-number">4.3.2.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NoTopicsThatVary</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"'topics that vary' are not allowed"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"that is, a variable is not allowed to have 'topic' as its kind of value. "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"(This would cause too much ambiguity with text variables, whose values "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"look exactly the same.)"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2_2">&#167;4.3.2.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_6" class="paragraph-anchor"></a><b>&#167;4.3.2.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for trying to create an instance of a unit</span><span class="named-paragraph-number">4.3.2.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;equation-name&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_MixedConstantsEquation</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The sentence %1 reads to me as if '%2' refers to something "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I should create as brand new - %3. But that can't be right, "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"and I suspect this may be because you've tried to create an "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"Equation but not given it a new paragraph."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_MixedConstants</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The sentence %1 reads to me as if '%2' refers to something "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I should create as brand new - %3. But that can't be right, "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"because this is a kind of value where I can't simply invent "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"new values. (Just as the numbers are ..., 1, 2, 3, ... and "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I can't invent a new one called 'Susan'.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_7" class="paragraph-anchor"></a><b>&#167;4.3.2.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for trying to create an instance of a table-defined kind</span><span class="named-paragraph-number">4.3.2.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_table</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">RTTables::table_defining_this</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_as</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_TableOfExistingKind2</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The sentence %1 reads to me as if '%2' refers to something "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I should create as brand new - %3. That looks reasonable, since "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"this is a kind which does have named values, but it's not "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"allowed because this is a kind which is defined by the rows "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"of a table (%4), not in isolated sentences like this one."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_8" class="paragraph-anchor"></a><b>&#167;4.3.2.8. </b>This is often a problem already reported, so we issue a fresh message only
if nothing has already been said:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue an unable-to-create problem message</span><span class="named-paragraph-number">4.3.2.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">problem_count_when_creator_started</span><span class="plain-syntax"> == </span><span class="identifier-syntax">problem_count</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"%W: %u\n$T\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">create_as</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NoNewInstances</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The sentence %1 reads to me as if '%2' refers to something "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I should create as brand new - %3. But that can't be right, "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"because this is a kind of value where I can't simply invent "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"new values. (Just as the numbers are ..., 1, 2, 3, ... and "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I can't invent a new one called 'Susan'.) %P"</span>
<span class="plain-syntax">            </span><span class="string-syntax">"Perhaps you wanted not to invent a constant but to make a "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"variable - that is, to give a name for a value which will "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"change during play. If so, try something like 'The bonus "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"is a number which varies'. %P"</span>
<span class="plain-syntax">            </span><span class="string-syntax">"Or perhaps you wanted to create a name as an alias for a "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"constant value. If so, try something like 'The lucky number "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"is always 8.' But this only makes a new name for the existing "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"number 8, it doesn't invent a new number."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2">&#167;4.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2_3_1" class="paragraph-anchor"></a><b>&#167;4.3.2.3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for certain forbidden kinds</span><span class="named-paragraph-number">4.3.2.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InstancesExplicit</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"this kind of value cannot be made with direct sentences like this"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"because the instances of this kind are made by the compiler itself, "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"using other notation in the source text to deduce them."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP4_3_2_3">&#167;4.3.2.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>It turns out to be useful to have the same policing rules elsewhere:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::vet_name</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::vet_name</span></span>:<br/>Table Columns - <a href="7-tc.html#SP12_2">&#167;12.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;creation-problem-diagnosis&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Creations to instantiate.</b>The <span class="extract"><span class="extract-syntax">COMMON_NOUN_NT</span></span> node sometimes means to talk about things in general,
sometimes things in particular; consider the two sentences
</p>

<blockquote>
    <p>A container is usually open. A container is in the Box Room.</p>
</blockquote>

<p class="commentary">We cannot easily differentiate these meanings. We will only be able to do so
by looking carefully at what the assertion does; studying the two sides of the
tree separately won't be good enough. So instantiation is done only at a few
points in "Make Assertions", and not as part of the process above.
</p>

<p class="commentary">Instantiation only ever creates objects, since values aren't allowed to be
nameless.
</p>

<p class="commentary">So: when it turns out that the <span class="extract"><span class="extract-syntax">COMMON_NOUN_NT</span></span> is to be made into something nameless
but tangible, as in the second sentence above, the following routine is used
to transform it into a suitable <span class="extract"><span class="extract-syntax">PROPER_NOUN_NT</span></span> referring to the newly created
object.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">name_stubs_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::convert_instance_to_nounphrase</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::convert_instance_to_nounphrase</span></span>:<br/>Assertions - <a href="4-ass.html#SP1">&#167;1</a>, <a href="4-ass.html#SP6_3_29">&#167;6.3.29</a>, <a href="4-ass.html#SP6_3_34_3">&#167;6.3.34.3</a>, <a href="4-ass.html#SP6_3_34_5">&#167;6.3.34.5</a>, <a href="4-ass.html#SP6_3_35">&#167;6.3.35</a>, <a href="4-ass.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP4_1" class="named-paragraph-link"><span class="named-paragraph">Check we are sure about this</span><span class="named-paragraph-number">4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">confect_name_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">BinaryPredicates::is_the_wrong_way_round</span><span class="plain-syntax">(</span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BinaryPredicates::get_reversal</span><span class="plain-syntax">(</span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">hinge_relation</span><span class="plain-syntax"> == </span><span class="identifier-syntax">R_incorporation</span><span class="plain-syntax">) </span><span class="identifier-syntax">confect_name_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">instance_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">CW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">; </span><span class="comment-syntax"> the calling</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;text-ending-with-a-calling&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::set_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">GET_RW</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;text-ending-with-a-calling&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">)); </span><span class="comment-syntax"> the text before the bracketed clause</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">CW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">GET_RW</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;text-ending-with-a-calling&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">); </span><span class="comment-syntax"> the bracketed text</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;article&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">CW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_2" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for calling something an article</span><span class="named-paragraph-number">8.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_kind_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Kinds::Behaviour::has_named_constant_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_1" class="named-paragraph-link"><span class="named-paragraph">Point out that it's impossible to create values implicitly for this kind</span><span class="named-paragraph-number">8.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_3" class="named-paragraph-link"><span class="named-paragraph">Calculate the instance count, that is, the number of duplicates to be made</span><span class="named-paragraph-number">8.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">list_subtree</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMMON_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">original_next</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4" class="named-paragraph-link"><span class="named-paragraph">Construct a list subtree containing the right number of duplicates</span><span class="named-paragraph-number">8.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Node::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">list_subtree</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax"> = </span><span class="identifier-syntax">original_next</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Point out that it's impossible to create values implicitly for this kind</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_CantCreateImplicitly</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"The sentence %1 seems to be asking me to create a new value (%2) "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"in order to be part of a relationship, but this isn't a kind of "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"value which I can just create new values for."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">multiplicity_ANNOT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_2" class="paragraph-anchor"></a><b>&#167;8.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for calling something an article</span><span class="named-paragraph-number">8.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">CW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_CalledArticle</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"The sentence %1 seems to be asking me to create something whose "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"name, '%2', is just an article - this isn't allowed."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_3" class="paragraph-anchor"></a><b>&#167;8.3. </b>Usually the instance count is 1, but noun phrases such as "six vehicles"
will raise it. The problem message here is almost a bit of social engineering:
we just don't think you're implementing it right if you think you need more
than 100 duplicate objects in one go. (Though it is true what the problem
message says about performance, too.)
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_DUPLICATES_AT_ONCE</span><span class="plain-syntax"> </span><span class="constant-syntax">100</span><span class="plain-syntax"> </span><span class="comment-syntax"> change the problem message below if this is changed</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Calculate the instance count, that is, the number of duplicates to be made</span><span class="named-paragraph-number">8.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">multiplicity_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">MAX_DUPLICATES_AT_ONCE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_TooManyDuplicates</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"at most 100 duplicates can be made at any one time"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"so '157 chairs are in the UN General Assembly' will not be allowed. The "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"system for handling duplicates during play becomes too slow and awkward "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"when there are so many."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">MAX_DUPLICATES_AT_ONCE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4" class="paragraph-anchor"></a><b>&#167;8.4. </b>For instance, "six vehicles" would make a binary tree here in which the
intermediate nodes are <span class="extract"><span class="extract-syntax">AND_NT</span></span> and the leaves <span class="extract"><span class="extract-syntax">PROPER_NOUN_NT</span></span>, each referring
to a different vehicle object.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Construct a list subtree containing the right number of duplicates</span><span class="named-paragraph-number">8.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">list_subtree</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;=</span><span class="identifier-syntax">instance_count</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new_instance</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4_1" class="named-paragraph-link"><span class="named-paragraph">Fashion a new object matching the description in the COMMON NOUN node</span><span class="named-paragraph-number">8.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">instance_count</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Node::set_type_and_clear_annotations</span><span class="plain-syntax">(</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">AND_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_subject_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">, </span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">attach_to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_subject_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">attach_to</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4_1" class="paragraph-anchor"></a><b>&#167;8.4.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Fashion a new object matching the description in the COMMON NOUN node</span><span class="named-paragraph-number">8.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">named_after</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">, </span><span class="identifier-syntax">NAW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">propriety</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4_1_1" class="named-paragraph-link"><span class="named-paragraph">Confect a name for the new object, if that's the bag we're into</span><span class="named-paragraph-number">8.4.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4_1_2" class="named-paragraph-link"><span class="named-paragraph">Check that the new name is non-empty and distinct from all existing ones</span><span class="named-paragraph-number">8.4.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wordings::truncate</span><span class="plain-syntax">(</span><span class="identifier-syntax">NW</span><span class="plain-syntax">, </span><span class="constant-syntax">32</span><span class="plain-syntax">); </span><span class="comment-syntax"> truncate to the maximum length</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pz</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">, </span><span class="identifier-syntax">NW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">new_instance</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::as_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">Instances::latest</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">named_after</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Naming::transfer_details</span><span class="plain-syntax">(</span><span class="identifier-syntax">named_after</span><span class="plain-syntax">, </span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        </span><a href="4-ass2.html#SP6" class="function-link"><span class="function-syntax">Assertions::Assemblies::name_object_after</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">, </span><span class="identifier-syntax">named_after</span><span class="plain-syntax">, </span><span class="identifier-syntax">NAW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">InferenceSubjects::is_an_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">named_after</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">InferenceSubjects::is_a_kind_of_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">named_after</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">propriety</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">propriety</span><span class="plain-syntax">) </span><span class="identifier-syntax">Naming::now_has_proper_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    </span><a href="4-rpt.html#SP1" class="function-link"><span class="function-syntax">Refiner::give_subject_to_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pz</span><span class="plain-syntax">, </span><span class="identifier-syntax">new_instance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Annotations::write_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pz</span><span class="plain-syntax">, </span><span class="identifier-syntax">creation_site_ANNOT</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-ass.html#SP6" class="function-link"><span class="function-syntax">Assertions::make_coupling</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pz</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8_4">&#167;8.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4_1_1" class="paragraph-anchor"></a><b>&#167;8.4.1.1. </b>The following is used only in assemblies, where the instance count is always
1, and confects a name like "Cleopatra's nose" from an owner object, "Cleopatra",
and an <span class="extract"><span class="extract-syntax">COMMON_NOUN_NT</span></span> node, "nose".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Confect a name for the new object, if that's the bag we're into</span><span class="named-paragraph-number">8.4.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owner</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_implicit_in_creation_of</span><span class="plain-syntax">(</span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">owner</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">instance_count</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        ((</span><span class="identifier-syntax">confect_name_flag</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">CW</span><span class="plain-syntax">)))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">OW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InferenceSubjects::get_name_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">owner</span><span class="plain-syntax">);</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subject_here</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">subject_here</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InferenceSubjects::get_name_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">subject_here</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">NW</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Wordings::empty</span><span class="plain-syntax">(</span><span class="identifier-syntax">CW</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">feed_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::begin</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Feeds::feed_C_string_expanding_strings</span><span class="plain-syntax">(</span><span class="identifier-syntax">U</span><span class="string-syntax">" its "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Feeds::feed_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">NW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::end</span><span class="plain-syntax">(</span><span class="identifier-syntax">id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">CW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">named_after</span><span class="plain-syntax"> = </span><span class="identifier-syntax">owner</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NAW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NW</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">feed_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::begin</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOOP_THROUGH_WORDING</span><span class="plain-syntax">(</span><span class="identifier-syntax">j</span><span class="plain-syntax">, </span><span class="identifier-syntax">CW</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;possessive-third-person&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::one_word</span><span class="plain-syntax">(</span><span class="identifier-syntax">j</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Insert the appropriate possessive</span><span class="named-paragraph-number">8.4.1.1.1</span></a></span>
<span class="plain-syntax">                </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;agent-pronoun&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::one_word</span><span class="plain-syntax">(</span><span class="identifier-syntax">j</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="4-tc.html#SP8_4_1_1_2" class="named-paragraph-link"><span class="named-paragraph">Insert the appropriate name</span><span class="named-paragraph-number">8.4.1.1.2</span></a></span>
<span class="plain-syntax">                </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">Feeds::feed_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::one_word</span><span class="plain-syntax">(</span><span class="identifier-syntax">j</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::end</span><span class="plain-syntax">(</span><span class="identifier-syntax">id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">NOUN_RESOLUTION</span><span class="plain-syntax">, </span><span class="string-syntax">"Confecting the name: &lt;%W&gt;\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8_4_1">&#167;8.4.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4_1_1_1" class="paragraph-anchor"></a><b>&#167;8.4.1.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Insert the appropriate possessive</span><span class="named-paragraph-number">8.4.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">genitive_form</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">PluginCalls::irregular_genitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">owner</span><span class="plain-syntax">, </span><span class="identifier-syntax">genitive_form</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">propriety</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::length</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">1</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Feeds::feed_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::trim_last_word</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">genitive_form</span><span class="plain-syntax">, </span><span class="string-syntax">"%+W's "</span><span class="plain-syntax">, </span><span class="identifier-syntax">Wordings::one_word</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::last_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Feeds::feed_text_expanding_strings</span><span class="plain-syntax">(</span><span class="identifier-syntax">genitive_form</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">genitive_form</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8_4_1_1">&#167;8.4.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4_1_1_2" class="paragraph-anchor"></a><b>&#167;8.4.1.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Insert the appropriate name</span><span class="named-paragraph-number">8.4.1.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Feeds::feed_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8_4_1_1">&#167;8.4.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4_1_2" class="paragraph-anchor"></a><b>&#167;8.4.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check that the new name is non-empty and distinct from all existing ones</span><span class="named-paragraph-number">8.4.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::empty</span><span class="plain-syntax">(</span><span class="identifier-syntax">NW</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InferenceSubjects::get_name_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">KindSubjects::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">instance_kind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;s-constant-value&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">NW</span><span class="plain-syntax">)) </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NW</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">textual_count</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">textual_count</span><span class="plain-syntax">, </span><span class="string-syntax">" %d "</span><span class="plain-syntax">, ++</span><span class="identifier-syntax">name_stubs_count</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">feed_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::begin</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Feeds::feed_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Feeds::feed_text_expanding_strings</span><span class="plain-syntax">(</span><span class="identifier-syntax">textual_count</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::end</span><span class="plain-syntax">(</span><span class="identifier-syntax">id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">textual_count</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-tc.html#SP8_4_1">&#167;8.4.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>This is how callings are parsed, both in assertions and conditions: that is,
names occurring in noun phrases with the shape "blah blah (called the rhubarb
rhubarb)". (For tedious reasons it would be inefficient to parse the second
of these using the first.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;text-ending-with-a-calling&gt;</span>
<span class="plain-syntax">    ... ( </span><span class="identifier-syntax">called</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> ... ) |</span>
<span class="plain-syntax">    ... ( </span><span class="identifier-syntax">called</span><span class="plain-syntax"> ... )</span>

<span class="function-syntax">&lt;text-including-a-calling&gt;</span>
<span class="plain-syntax">    ... ( </span><span class="identifier-syntax">called</span><span class="plain-syntax"> ... ) ***</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>Many names are rejected because they clash unfortunately with other things,
or for other high-level reasons, but there are also some basic syntactic
blunders. Most of the time those are caught by the Creator above, but in a few
cases (declaring new figures, for instance) it's possible to get around
the standard checks, and in that case problems are picked up here.
</p>

<p class="commentary">&lt;unfortunate-name&gt; is a stricter test than &lt;unsuitable-name&gt;.
For example, property names can't be unsuitable, but they can be unfortunate.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;unsuitable-name&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;article&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    *** (/)/{/}/,/./(- *** |</span>
<span class="plain-syntax">    *** </span><span class="function-syntax">&lt;quoted-text&gt;</span><span class="plain-syntax"> ***</span>

<span class="function-syntax">&lt;unsuitable-name-for-locals&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;definite-article&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    *** (/)/{/}/,/. *** |</span>
<span class="plain-syntax">    *** </span><span class="function-syntax">&lt;quoted-text&gt;</span><span class="plain-syntax"> ***</span>

<span class="function-syntax">&lt;unfortunate-name&gt;</span>
<span class="plain-syntax">    ... </span><span class="identifier-syntax">with</span><span class="plain-syntax">/</span><span class="identifier-syntax">having</span><span class="plain-syntax">/</span><span class="identifier-syntax">and</span><span class="plain-syntax">/</span><span class="identifier-syntax">or</span><span class="plain-syntax"> ... |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;unsuitable-name&gt;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>Which powers:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::vet_name_for_noun</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Assertions::Creator::vet_name_for_noun</span></span>:<br/>Pluralisation Requests - <a href="3-pr.html#SP2">&#167;2</a><br/>Focus and Outcome - <a href="6-fao.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;unfortunate-name&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NameBestAvoided</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"this is a name which is best avoided"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"because it would lead to confusion inside Inform. In general, try "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"to avoid punctuation, quotation marks, or the words 'with' or "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"'having' in names like this. (Hyphens are fine, so by all means "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"use a name like 'Church-with-Spire', if that will help.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. The natural language kind.</b>Inform has a kind built in called "natural language", whose values are
enumerated names: English language, French language, German language and so on.
When the kind is created, the following function makes instances for whichever
languages we might need to print in at runtime: which will be English, perhaps
with one other, if the language of play is not English.
</p>

<p class="commentary">We do this exactly as we would to create any other instance &mdash; we write a logical
proposition claiming its existence, then assert it to be true.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">NOTIFY_NATURAL_LANGUAGE_KINDS_CALLBACK</span><span class="plain-syntax"> </span><a href="4-tc.html#SP12" class="function-link"><span class="function-syntax">Assertions::Creator::stock_nl_kind</span></a>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::stock_nl_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inform_language</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">primary_Preform_language</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="4-tc.html#SP12" class="function-link"><span class="function-syntax">Assertions::Creator::stock_nl_kind_with_one</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inform_language</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LOP</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Projects::get_language_of_play</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::project</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LOP</span><span class="plain-syntax"> != </span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><a href="4-tc.html#SP12" class="function-link"><span class="function-syntax">Assertions::Creator::stock_nl_kind_with_one</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">LOP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Assertions::Creator::stock_nl_kind_with_one</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">inform_language</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="8-cu.html#SP1" class="function-link"><span class="function-syntax">Propositions::Abstract::to_create_something</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">instance_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Assert::true</span><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">L</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nl_instance</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::latest</span><span class="plain-syntax">();</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-rpt.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-am.html">1</a></li><li class="progresschapter"><a href="2-bv.html">2</a></li><li class="progresschapter"><a href="3-dlr.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-nr.html">nr</a></li><li class="progresssection"><a href="4-rpt.html">rpt</a></li><li class="progresscurrent">tc</li><li class="progresssection"><a href="4-ass.html">ass</a></li><li class="progresssection"><a href="4-npa.html">npa</a></li><li class="progresssection"><a href="4-pk.html">pk</a></li><li class="progresssection"><a href="4-rk.html">rk</a></li><li class="progresssection"><a href="4-ass2.html">ass2</a></li><li class="progresssection"><a href="4-imp.html">imp</a></li><li class="progresschapter"><a href="5-id.html">5</a></li><li class="progresschapter"><a href="6-rls.html">6</a></li><li class="progresschapter"><a href="7-tc.html">7</a></li><li class="progresschapter"><a href="8-kpr.html">8</a></li><li class="progressnext"><a href="4-ass.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

